﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects;
using mitasoft.Books.Core;

namespace mitasoft.Books.DataLayer
{
    public partial class BooksDatabaseEntities : ObjectContext
    {

        /// <summary>
        /// Insert a list of books
        /// </summary>
        /// <param name="listOfBooks"></param>
        public void BulkInsertBooks(List<FileDescriptor> listOfBooks)
        {
            foreach (var book in listOfBooks)
            {
                this.BookFiles.AddObject(new BookFile { ID = Guid.NewGuid(), Path = book.FilePath, Title = book.FileName });
            }
        }
   

    
    }
}
